package com.example.home_form.homework;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class FormInfoController {

    @Resource(name = "studentInfo20Service")
    private FormInfoService formInfoService;


    @ResponseBody
    public int queryCount() {
        return formInfoService.queryCount();
    }

    public String queryById(String studentId, Model model) {
        model.addAttribute("student", formInfoService.queryById(studentId));
        return "studentInfo20";
    }

    public String queryOne(FormInfo formInfo, Model model) {
        FormInfo formInfo201 = formInfoService.queryOne(formInfo);
        model.addAttribute("student", formInfo201);
        return "studentInfo20";
    }


}

